import assessCheckApi from './api'
import { axios } from '@/utils/request'
import router from '@/router/index'
import blobType from '@/common/blobType'
var menuType = blobType.menuType
var fywflcodeArr = blobType.fywflcodeArr
var fywflcode = ''
//根据Id查询
export function initZltxwjFlow(params){
    fywflcode = fywflcodeArr[menuType.indexOf(router.app._route. name.substring(router.app._route.name.indexOf('__'),router.app._route.name.indexOf('_a')+2))]
    return axios({
      url: assessCheckApi.initZltxwjFlow,
      method:'get' ,
      params:params?{...params,fywflcode:fywflcode?fywflcode:(params.fywflcode?params.fywflcode:'')}:{},
      url_1:'outside'
    })
}

//获取编码
export function getSqsxBm(params){
    fywflcode = fywflcodeArr[menuType.indexOf(router.app._route. name.substring(router.app._route.name.indexOf('__'),router.app._route.name.indexOf('_a')+2))]
    return axios({
      url: assessCheckApi.getSqsxBm,
      method:'get' ,
      params:params?{...params,fywflcode:fywflcode?fywflcode:(params.fywflcode?params.fywflcode:'')}:{},
      url_1:'outside'
    })
  }

  export function queryTreeList(params){
    return axios({
      url: assessCheckApi.queryTreeList,
      method:'get' ,
      params:{...params},
      url_1:'outside'
    })
  }
  //添加
  export function addZltxwj(params){
    return axios({
      url: assessCheckApi.addZltxwj,
      method:'post' ,
      data:{...params},
      url_1:'outside'
    })
  }
  //编辑
  export function editZltxwj(parameter) {
    return axios({
      url: assessCheckApi.editZltxwj,
      method:'put',
      data: parameter,
      url_1:'outside'
    })
  }
  export function queryById(params){
    return axios({
      url: assessCheckApi.queryById,
      method:'get' ,
      params:{...params},
      url_1:'outside'
    })
  }
  //上传
  export function uploadZltxwjFile(data){
    return axios({
      url: assessCheckApi.uploadZltxwjFile,
      method:'post' ,
      data:data,
      url_1:'outside',
      responseType: 'arraybuffer'
    })
  }

  //删除
  export function deleteBatch(params){
    return axios({
      url: assessCheckApi.deleteBatch,
      method:'delete' ,
      params:{...params},
      url_1:'outside'
    })
  }

  // 下载文件
export function downloadFile(params){
  return axios({
    url: assessCheckApi.getZltxwjFile,
    method:'get' ,
    params:{...params},
    url_1:'outside',
    responseType: 'arraybuffer'
  })
}

export function spcyZltxwjHistoryGetZltxwjFile(params){
  return axios({
    url: assessCheckApi.spcyZltxwjHistoryGetZltxwjFile,
    method:'get' ,
    params:{...params},
    url_1:'outside',
    responseType: 'arraybuffer'
  })
}

//导入
export function leadingInExccel(parameter){
  return axios({
    url:assessCheckApi.impZltxwjData,
    method:'post',
    data:parameter,
    url_1:'outside',
    responseType: 'arraybuffer'
  })
}

//导出
export function leadingOutExccel(params){
  return axios({
    url: assessCheckApi.exportZltxwjData,
    method:'get' ,
    params:{...params},
    url_1:'outside',
    responseType: 'arraybuffer'
  })
}

export function downloadZipFile(parameter){
  return axios({
    url:assessCheckApi.downloadZipFile,
    method:'post',
    data:parameter,
    url_1:'outside',
    responseType: 'arraybuffer'
  })
}
//下载模板
export function leadingOutFormwork(params){
  return axios({
    url: assessCheckApi.downZltxwjTemplate,
    method:'get' ,
    params:{...params},
    url_1:'outside',
    responseType: 'arraybuffer'
  })
}

export function spcyZltxwjBasiczltxwjGzSk(parameter){
  return axios({
    url:assessCheckApi.spcyZltxwjBasiczltxwjGzSk,
    method:'post',
    data:parameter,
    url_1:'outside',
  })
}

export function spcyZltxwjBasiczltxwjGzSx(parameter){
  return axios({
    url:assessCheckApi.spcyZltxwjBasiczltxwjGzSx,
    method:'post',
    data:parameter,
    url_1:'outside',
  })
}
export function zltxwjClientOfficeApigetZltxwjFile(params){
  return axios({
    url: assessCheckApi.zltxwjClientOfficeApigetZltxwjFile,
    method:'get' ,
    params:{...params},
    url_1:'outside',
    responseType: 'arraybuffer'
  })
}

export function zltxwjClientOfficeApigetLsZltxwjFile(params){
  return axios({
    url: assessCheckApi.zltxwjClientOfficeApigetLsZltxwjFile,
    method:'get' ,
    params:{...params},
    url_1:'outside',
    responseType: 'arraybuffer'
  })
}

export function spcyZltxwjBasicsetYxxz(parameter){
  return axios({
    url:assessCheckApi.spcyZltxwjBasicsetYxxz,
    method:'post',
    data:parameter,
    url_1:'outside',
  })
}
export function spcyZltxwjBasicsetNotYxxz(parameter){
  return axios({
    url:assessCheckApi.spcyZltxwjBasicsetNotYxxz,
    method:'post',
    data:parameter,
    url_1:'outside',
  })
}



